class User < ActiveRecord::Base
  attr_accessible :id, :password, :role, :salt, :username
  validates :id, :presence => true, { :with => /([a-zA-Z0-9])*@([a-zA-Z0-9])*\.([a-zA-Z0-9])*/i, :on => :create } #id === email for this model
  validates :password, :presence => true, :length { :minimum => 8}, {:with=> /([a-zA-z0-9_])+/}
  validates :salt, :presence => true
  validates :username, :presence => true
end
